function wordsToBytes(e) {
  for (var t = [], r = 0; r < 32 * e.length; r += 8)
    t.push((e[r >>> 5] >>> (24 - (r % 32))) & 255);
  return t;
}
function fstringToBytes(e) {
  return istringToBytes(unescape(encodeURIComponent(e)));
}

function istringToBytes(e) {
  for (var t = [], r = 0; r < e.length; r++) t.push(255 & e.charCodeAt(r));
  return t;
}

function bytesToWords(e) {
  for (var t = [], r = 0, n = 0; r < e.length; r++, n += 8)
    t[n >>> 5] |= e[r] << (24 - (n % 32));
  return t;
}
function _ff(e, t, r, n, i, o, a) {
  var s = e + ((t & r) | (~t & n)) + (i >>> 0) + a;
  return ((s << o) | (s >>> (32 - o))) + t;
}
function _gg(e, t, r, n, i, o, a) {
  var s = e + ((t & n) | (r & ~n)) + (i >>> 0) + a;
  return ((s << o) | (s >>> (32 - o))) + t;
}
function _hh(e, t, r, n, i, o, a) {
  var s = e + (t ^ r ^ n) + (i >>> 0) + a;
  return ((s << o) | (s >>> (32 - o))) + t;
}
function _ii(e, t, r, n, i, o, a) {
  var s = e + (r ^ (t | ~n)) + (i >>> 0) + a;
  return ((s << o) | (s >>> (32 - o))) + t;
}
function rotl(e, t) {
  return (e << t) | (e >>> (32 - t));
}

function endian(e) {
  if (e.constructor == Number)
    return (16711935 & rotl(e, 8)) | (4278255360 & rotl(e, 24));
  for (var t = 0; t < e.length; t++) e[t] = endian(e[t]);
  return e;
}

function binbinstringToBytes(e) {
  for (var t = [], r = 0; r < e.length; r++) t.push(255 & e.charCodeAt(r));
  return t;
}
function md52(t, r) {
  t.constructor == String
    ? (t =
        r && "binary" === r.encoding
          ? binbinstringToBytes(t)
          : fstringToBytes(t))
    : isBuffer2(t)
    ? (t = Array.prototype.slice.call(t, 0))
    : Array.isArray(t) || t.constructor === Uint8Array || (t = t.toString());
  for (
    var n = bytesToWords(t),
      i = 8 * t.length,
      o = 1732584193,
      a = -271733879,
      s = -1732584194,
      l = 271733878,
      c = 0;
    c < n.length;
    c++
  )
    n[c] =
      (16711935 & ((n[c] << 8) | (n[c] >>> 24))) |
      (4278255360 & ((n[c] << 24) | (n[c] >>> 8)));
  (n[i >>> 5] |= 128 << i % 32), (n[14 + (((i + 64) >>> 9) << 4)] = i);
  var u = _ff,
    d = _gg,
    p = _hh,
    h = _ii;
  for (c = 0; c < n.length; c += 16) {
    var f = o,
      m = a,
      v = s,
      g = l;
    (o = u(o, a, s, l, n[c + 0], 7, -680876936)),
      (l = u(l, o, a, s, n[c + 1], 12, -389564586)),
      (s = u(s, l, o, a, n[c + 2], 17, 606105819)),
      (a = u(a, s, l, o, n[c + 3], 22, -1044525330)),
      (o = u(o, a, s, l, n[c + 4], 7, -176418897)),
      (l = u(l, o, a, s, n[c + 5], 12, 1200080426)),
      (s = u(s, l, o, a, n[c + 6], 17, -1473231341)),
      (a = u(a, s, l, o, n[c + 7], 22, -45705983)),
      (o = u(o, a, s, l, n[c + 8], 7, 1770035416)),
      (l = u(l, o, a, s, n[c + 9], 12, -1958414417)),
      (s = u(s, l, o, a, n[c + 10], 17, -42063)),
      (a = u(a, s, l, o, n[c + 11], 22, -1990404162)),
      (o = u(o, a, s, l, n[c + 12], 7, 1804603682)),
      (l = u(l, o, a, s, n[c + 13], 12, -40341101)),
      (s = u(s, l, o, a, n[c + 14], 17, -1502002290)),
      (o = d(
        o,
        (a = u(a, s, l, o, n[c + 15], 22, 1236535329)),
        s,
        l,
        n[c + 1],
        5,
        -165796510
      )),
      (l = d(l, o, a, s, n[c + 6], 9, -1069501632)),
      (s = d(s, l, o, a, n[c + 11], 14, 643717713)),
      (a = d(a, s, l, o, n[c + 0], 20, -373897302)),
      (o = d(o, a, s, l, n[c + 5], 5, -701558691)),
      (l = d(l, o, a, s, n[c + 10], 9, 38016083)),
      (s = d(s, l, o, a, n[c + 15], 14, -660478335)),
      (a = d(a, s, l, o, n[c + 4], 20, -405537848)),
      (o = d(o, a, s, l, n[c + 9], 5, 568446438)),
      (l = d(l, o, a, s, n[c + 14], 9, -1019803690)),
      (s = d(s, l, o, a, n[c + 3], 14, -187363961)),
      (a = d(a, s, l, o, n[c + 8], 20, 1163531501)),
      (o = d(o, a, s, l, n[c + 13], 5, -1444681467)),
      (l = d(l, o, a, s, n[c + 2], 9, -51403784)),
      (s = d(s, l, o, a, n[c + 7], 14, 1735328473)),
      (o = p(
        o,
        (a = d(a, s, l, o, n[c + 12], 20, -1926607734)),
        s,
        l,
        n[c + 5],
        4,
        -378558
      )),
      (l = p(l, o, a, s, n[c + 8], 11, -2022574463)),
      (s = p(s, l, o, a, n[c + 11], 16, 1839030562)),
      (a = p(a, s, l, o, n[c + 14], 23, -35309556)),
      (o = p(o, a, s, l, n[c + 1], 4, -1530992060)),
      (l = p(l, o, a, s, n[c + 4], 11, 1272893353)),
      (s = p(s, l, o, a, n[c + 7], 16, -155497632)),
      (a = p(a, s, l, o, n[c + 10], 23, -1094730640)),
      (o = p(o, a, s, l, n[c + 13], 4, 681279174)),
      (l = p(l, o, a, s, n[c + 0], 11, -358537222)),
      (s = p(s, l, o, a, n[c + 3], 16, -722521979)),
      (a = p(a, s, l, o, n[c + 6], 23, 76029189)),
      (o = p(o, a, s, l, n[c + 9], 4, -640364487)),
      (l = p(l, o, a, s, n[c + 12], 11, -421815835)),
      (s = p(s, l, o, a, n[c + 15], 16, 530742520)),
      (o = h(
        o,
        (a = p(a, s, l, o, n[c + 2], 23, -995338651)),
        s,
        l,
        n[c + 0],
        6,
        -198630844
      )),
      (l = h(l, o, a, s, n[c + 7], 10, 1126891415)),
      (s = h(s, l, o, a, n[c + 14], 15, -1416354905)),
      (a = h(a, s, l, o, n[c + 5], 21, -57434055)),
      (o = h(o, a, s, l, n[c + 12], 6, 1700485571)),
      (l = h(l, o, a, s, n[c + 3], 10, -1894986606)),
      (s = h(s, l, o, a, n[c + 10], 15, -1051523)),
      (a = h(a, s, l, o, n[c + 1], 21, -2054922799)),
      (o = h(o, a, s, l, n[c + 8], 6, 1873313359)),
      (l = h(l, o, a, s, n[c + 15], 10, -30611744)),
      (s = h(s, l, o, a, n[c + 6], 15, -1560198380)),
      (a = h(a, s, l, o, n[c + 13], 21, 1309151649)),
      (o = h(o, a, s, l, n[c + 4], 6, -145523070)),
      (l = h(l, o, a, s, n[c + 11], 10, -1120210379)),
      (s = h(s, l, o, a, n[c + 2], 15, 718787259)),
      (a = h(a, s, l, o, n[c + 9], 21, -343485551)),
      (o = (o + f) >>> 0),
      (a = (a + m) >>> 0),
      (s = (s + v) >>> 0),
      (l = (l + g) >>> 0);
  }
  return endian([o, a, s, l]);
}
function bytesToHex(e) {
  for (var t = [], r = 0; r < e.length; r++)
    t.push((e[r] >>> 4).toString(16)), t.push((15 & e[r]).toString(16));
  return t.join("");
}

function md5(e, t = undefined) {
  console.log("e", e);
  if (null == e) throw new Error("Illegal argument " + e);
  var r = wordsToBytes(md52(e, t));
  return bytesToHex(r);
}
function formatImgByLocalParams(e, t) {
  t || (t = {});

  var r = getImgFormatConfig(t),
    n = r.imgKey,
    i = r.subKey;

  if (n && i) {
    for (
      var o = getPictureHashKey(n + i),
        a = Math.round(Date.now() / 1e3),
        s = Object.assign({}, e, {
          wts: a,
        }),
        l = Object.keys(s).sort(),
        c = [],
        u = /[!'()*]/g,
        d = 0;
      d < l.length;
      d++
    ) {
      var p = l[d],
        h = s[p];
      h && "string" == typeof h && (h = h.replace(u, "")),
        null != h &&
          c.push(
            "".concat(encodeURIComponent(p), "=").concat(encodeURIComponent(h))
          );
    }
    var f = c.join("&");

    return {
      w_rid: md5(f + o),
      wts: a.toString(),
    };
  }
  return null;
}
function getImgFormatConfig(e) {
  var t;
  if (e.useAssignKey)
    return {
      imgKey: e.wbiImgKey,
      subKey: e.wbiSubKey,
    };
  var r = [
    "https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png",

    "https://i0.hdslb.com/bfs/wbi/4932caff0ff746eab6f01bf08b70ac45.png",
  ];
  (n = r[0]), (i = r[1]);
  return {
    imgKey: n ? getKeyFromURL(n) : e.wbiImgKey,
    subKey: i ? getKeyFromURL(i) : e.wbiSubKey,
  };
}
function getKeyFromURL(e) {
  return e.substring(e.lastIndexOf("/") + 1, e.length).split(".")[0];
}
const LOCAL_STORAGE_KEY$1 = "wbi_img_urls";
function getLocal(e) {
  try {
    return localStorage.getItem(e);
  } catch (e2) {
    return null;
  }
}
function getPictureHashKey(e) {
  var t = [];
  return (
    [
      46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5,
      49, 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55,
      40, 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57,
      62, 11, 36, 20, 34, 44, 52,
    ].forEach(function (r) {
      e.charAt(r) && t.push(e.charAt(r));
    }),
    t.join("").slice(0, 32)
  );
}

const e = {
  web_location: "333.337",
};

const t = {
  wbiImgKey: "c458435a75b1419ca98ab6d88b4c60d4",
  wbiSubKey: "446140f6859f439e9dd83f7ef858d1cd",
};

// const w_rid = formatImgByLocalParams(e, t)["w_rid"];
// const wts = formatImgByLocalParams(e, t)["wts"];
// console.log(formatImgByLocalParams(e, t));

// async function fetchBilibiliData(w_rid, wts) {
//   const params = new URLSearchParams({
//     pn: "1",
//     ps: "40",
//     tid: "0",
//     special_type: "",
//     order: "click",
//     mid: "232004597",
//     index: "0",
//     keyword: "",
//     order_avoided: "true",
//     platform: "web",
//     web_location: "333.1387",
//     dm_img_list:
//       '[{"x":2379,"y":3011,"z":0,"timestamp":3355,"k":111,"type":0},{"x":2530,"y":2680,"z":79,"timestamp":3456,"k":125,"type":0},{"x":2541,"y":2281,"z":9,"timestamp":3559,"k":104,"type":0},{"x":2832,"y":2452,"z":269,"timestamp":3659,"k":116,"type":0},{"x":2948,"y":2484,"z":361,"timestamp":3760,"k":84,"type":0},{"x":2895,"y":2382,"z":294,"timestamp":3863,"k":73,"type":0},{"x":3447,"y":776,"z":420,"timestamp":5204,"k":78,"type":0},{"x":3178,"y":590,"z":592,"timestamp":5305,"k":96,"type":0},{"x":2391,"y":-153,"z":64,"timestamp":5406,"k":60,"type":0},{"x":2530,"y":45,"z":256,"timestamp":5527,"k":88,"type":0},{"x":2029,"y":-272,"z":31,"timestamp":5631,"k":104,"type":0},{"x":2839,"y":618,"z":969,"timestamp":5732,"k":114,"type":0},{"x":2552,"y":340,"z":701,"timestamp":5836,"k":77,"type":0}]',
//     dm_img_str: "V2ViR0wgMS4wIChPcGVuR0wgRVMgMi4wIENocm9taXVtKQ",
//     dm_cover_img_str:
//       "QU5HTEUgKEludGVsLCBJbnRlbChSKSBJcmlzKFIpIFhlIEdyYXBoaWNzICgweDAwMDA5QTQ5KSBEaXJlY3QzRDExIHZzXzVfMCBwc181XzAsIEQzRDExKUdvb2dsZSBJbmMuIChJbnRlbC",
//     dm_img_inter:
//       '{"ds":[{"t":2,"c":"cmFkaW8tZmlsdGVyX19pdGVtIHJhZGlvLWZpbHRlcl9faXRlbS0tYWN0aX","p":[1490,96,880],"s":[229,555,666]}],"wh":[4175,5400,77],"of":[708,1254,465]}',
//     w_webid:
//       "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzcG1faWQiOiIzMzMuMTM4NyIsImJ1dmlkIjoiRDkzQzUyMDAtMkJGMi1FRkM4LTQ1RjEtRjFFNzY3MTg1MzdCNDE4OTJpbmZvYyIsInVzZXJfYWdlbnQiOiJNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wOyBXaW42NDsgeDY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvMTM2LjAuMC4wIFNhZmFyaS81MzcuMzYgRWRnLzEzNi4wLjAuMCIsImJ1dmlkX2ZwIjoiY2Q2ODgwNTU2ZDg1YTUyY2ZjNjNiOTBiZjQwNjY2ZjMiLCJiaWxpX3RpY2tldCI6ImV5SmhiR2NpT2lKSVV6STFOaUlzSW10cFpDSTZJbk13TXlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKbGVIQWlPakUzTkRneE5UYzNNalVzSW1saGRDSTZNVGMwTnpnNU9EUTJOU3dpY0d4MElqb3RNWDAuYXBRS2J6TF9WekR2SEdwNmpjWkVCTVFoZkRreXNCN2JBYmxVVmFSUE1ZSSIsImNyZWF0ZWRfYXQiOjE3NDgwNjcwMDEsInR0bCI6ODY0MDAsInVybCI6Ii8yMzIwMDQ1OTcvdXBsb2FkL3ZpZGVvIiwicmVzdWx0IjowLCJpc3MiOiJnYWlhIiwiaWF0IjoxNzQ4MDY3MDAxfQ.cIR5PhWXyP2bi12fVEiyFxag2DSrA3Z43ucSiM2qT3SqqnkDLhDPXq2lLkg41qprEncMTp5OjbS0Y72o9dlBgtWe_h7tUnFtJRIcvXbun9YfKmI-cq_bgxxeuDmgUlj4qY27YfR0Tk4ONIaeIKEDGd8ruV1_aYv6b2ZapGs_XxXXyxD00pre0m5xL38sknw6BU02hg4bhfavAqMayisetqRKGZUqL3a3Q6BLSfTn_IQa9m3y6Kbrz3ncbeTLFrOZ4Phte5wjpO-vhvviM93xy6ujm6JNZhX60kqi0uHmEIwMPe6igjd8ZSLCo9RKD_SVL3VFw2QCYLyT-7YfpwzcLw",

//     w_rid: w_rid,
//     wts: wts,
//   });
//   // console.log(`https://api.bilibili.com/x/space/wbi/arc/search?${params}`);
//   const response = await fetch(
//     `https://api.bilibili.com/x/space/wbi/arc/search?${params}`,
//     {
//       method: "GET",
//       headers: {
//         "User-Agent":
//           "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0",
//         Referer: "https://space.bilibili.com/232004597/video",
//         cookie:
//           "buvid3=D93C5200-2BF2-EFC8-45F1-F1E76718537B41892infoc; b_nut=1747732341; _uuid=B64105723-7BBA-10F94-104BD-171089314D27242249infoc; buvid4=FEC348DB-B334-9C12-8182-331E435EAC2142423-025052017-ug5BUSaWjDVat0NNvnwwdA%3D%3D; header_theme_version=CLOSE; enable_web_push=DISABLE; enable_feed_channel=ENABLE; home_feed_column=5; DedeUserID=1493259707; DedeUserID__ckMd5=c5d05f93da6508f5; rpdid=|(u)Yl|YlmJ)0J'u~R~~JkJ~l; hit-dyn-v2=1; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDgxNTc3MjUsImlhdCI6MTc0Nzg5ODQ2NSwicGx0IjotMX0.apQKbzL_VzDvHGp6jcZEBMQhfDkysB7bAblUVaRPMYI; bili_ticket_expires=1748157665; fingerprint=cd6880556d85a52cfc63b90bf40666f3; buvid_fp_plain=undefined; opus-goback=1; SESSDATA=523dfda1%2C1763474661%2Cb9dc9%2A51CjCTAvnOwt_7LeEo_VcqGmW4aZTABdLCToCbKyAc0QJUp8Tt9NA5wPAv8D6hbOzt2noSVmM1WXRQUXFyUVFOZG1nUmlKZXRhOU9WeEVSOVlNVGx1XzBlbDlISXFFc0tFOWJvNU8zNUdqTDVpOEdDQnZWeTJDa3ZCMTdHaEZ1OFhKWDNjQzdVTUV3IIEC; bili_jct=10c166e073b855f6fdece1c65b891872; buvid_fp=cd6880556d85a52cfc63b90bf40666f3; browser_resolution=1459-777; b_lsid=B1010D1A18_19700A7AE9B; sid=7nlgnjfc; CURRENT_FNVAL=2000; bp_t_offset_1493259707=1070410832048816128",
//         origin: "https://space.bilibili.com",
//         "sec-fetch-dest": "empty",
//         "sec-ch-ua-platform": "Windows",
//         "Sec-Ch-Ua":
//           'Chromium";v="136", "Microsoft Edge";v="136", "Not.A/Brand";v="99', // 浏览器UA扩展信息
//         "Sec-Ch-Ua-Mobile": "?0", // 非移动设备
//         Accept: "*/*", // 接受所有类型响应
//         "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", // 语言偏好
//         "accept-encoding": "gzip, deflate, br, zstd",
//       },
//     }
//   );

//   if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
//   return await response.json();
// }

// // 使用示例
// fetchBilibiliData(w_rid, wts)
//   .then((data) => console.log(data))
//   .catch((error) => console.error("Error:", error));

const w_rid = "4f1600db409948a12a58e4d1e9efe229";
const wts = "1748086639";
// const w_rid = "846e0b3e8f4c08a7462cbcdec1f399cb";
// const wts = "1748076206";/

const params = new URLSearchParams();
params.append("pn", "1");
params.append("ps", "40");
params.append("tid", "0");
params.append("special_type", "");
params.append("order", "pubdate");
// params.append("order", "pubdate");
params.append("mid", "232004597");
// params.append("mid", "3493110839511225");//
params.append("index", "0");
params.append("keyword", "");
params.append("order_avoided", "true");
params.append("platform", "web");
params.append("web_location", "333.1387");
params.append(
  "dm_img_list",
  "[]"
  // '[{"x":1332,"y":304,"z":0,"timestamp":560,"k":69,"type":0}]'
  // '[{"x":2375,"y":3021,"z":0,"timestamp":3859,"k":111,"type":0},{"x":2557,"y":1782,"z":98,"timestamp":4010,"k":114,"type":0},{"x":2440,"y":1392,"z":110,"timestamp":4112,"k":123,"type":0},{"x":2176,"y":960,"z":28,"timestamp":4223,"k":62,"type":0},{"x":2243,"y":1020,"z":139,"timestamp":10252,"k":65,"type":0},{"x":2496,"y":1288,"z":393,"timestamp":10353,"k":100,"type":0},{"x":2731,"y":1537,"z":632,"timestamp":10454,"k":98,"type":0},{"x":2409,"y":1313,"z":338,"timestamp":10555,"k":85,"type":0},{"x":2919,"y":1858,"z":858,"timestamp":10656,"k":111,"type":0},{"x":2264,"y":1210,"z":205,"timestamp":10891,"k":82,"type":0},{"x":2621,"y":1766,"z":632,"timestamp":10992,"k":103,"type":0},{"x":2473,"y":1755,"z":533,"timestamp":11093,"k":107,"type":0},{"x":2052,"y":1340,"z":117,"timestamp":11531,"k":121,"type":0},{"x":2099,"y":1365,"z":207,"timestamp":11631,"k":114,"type":0},{"x":2687,"y":2100,"z":1021,"timestamp":11732,"k":78,"type":0},{"x":2077,"y":1746,"z":609,"timestamp":11833,"k":115,"type":0},{"x":1859,"y":1611,"z":441,"timestamp":11933,"k":69,"type":0},{"x":2497,"y":2311,"z":1123,"timestamp":12034,"k":69,"type":0},{"x":3106,"y":2924,"z":1789,"timestamp":12134,"k":121,"type":0},{"x":2176,"y":2001,"z":884,"timestamp":12239,"k":79,"type":0}]'
);
params.append("dm_img_str", "V2ViR0wgMS4wIChPcGVuR0wgRVMgMi4wIENocm9taXVtKQ"); //WebGL 1.0 (OpenGL ES 2.0 Chromium)）

params.append(
  //相同
  "dm_cover_img_str",
  "QU5HTEUgKEludGVsLCBJbnRlbChSKSBJcmlzKFIpIFhlIEdyYXBoaWNzICgweDAwMDA5QTQ5KSBEaXJlY3QzRDExIHZzXzVfMCBwc181XzAsIEQzRDExKUdvb2dsZSBJbmMuIChJbnRlbC" //ANGLE (Intel, Intel(R) Iris(R) Xe Graphics (0x00009A49) Direct3D11 vs_5_0 ps_5_0, D3D11)Google Inc. (Intel
  // QU5HTEUgKEludGVsLCBJbnRlbChSKSBJcmlzKFIpIFhlIEdyYXBoaWNzICgweDAwMDA5QTQ5KSB/EaXJlY3QzRDExIHZzXzVfMCBwc181XzAsIEQzRDExKUdvb2dsZSBJbmMuIChJbnRlbC
);
params.append(
  "dm_img_inter",
  '{"ds":[],"wh":[3688,5211,106],"of":[461,922,461]}'
  // '{"ds":[{"t":0,"c":"bnByb2dyZXNzLWJ1c3","p":[153,51,51],"s":[36,5253,3068]}],"wh":[3460,5135,30],"of":[141,282,141]}'
  // '{"ds":[{"t":2,"c":"cmFkaW8tZmlsdGVyX19pdGVtIHJhZGlvLWZpbHRlcl9faXRlbS0tYWN0aX","p":[863,33,-59],"s":[153,479,514]}],"wh":[3628,5651,68],"of":[982,1364,82]}'
);
// params.append(
//   //在页面获得
//   "w_webid",
//   "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzcG1faWQiOiIzMzMuMTM4NyIsImJ1dmlkIjoiRDkzQzUyMDAtMkJGMi1FRkM4LTQ1RjEtRjFFNzY3MTg1MzdCNDE4O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eyU8EsZHE8HuMMSvaIg3EddOGk5QH0APypmE7oofc8XLVD5GHlfAbbrNrasO6Rzc-P1vazbuTrAYOkmuZqyEASWUaC6YHtvP9k1BN1zOeYT5nhawvt2Jg"
// );

params.append("w_rid", w_rid);
params.append("wts", wts);

const url = `https://api.bilibili.com/x/space/wbi/arc/search?${params.toString()}`;
// console.log(`https://api.bilibili.com/x/space/wbi/arc/search?${params}`);
async function management_button() {
  const response = await fetch(url, {
    method: "GET",
    headers: {
      "User-Agent":
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0",
      Referer: "https://space.bilibili.com/3493110839511225/video",
      // cookie:
      //   "buvid3=D93C5200-2BF2-EFC8-45F1-F1E76718537B41892infoc; b_nut=1747732341;",
      // origin: "https://space.bilibili.com",
      // "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8", // 语言偏好
    },
  });

  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);

  return await response.json();
}
const mmmmm = await management_button();
console.log(mmmmm);
